<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<title>我的</title>
		<meta http-equiv="expires" content="0">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<link rel="stylesheet" href="../../../css/reset.css" />
		<link rel="stylesheet" href="../../../css/mui.min.css" />
		<link rel="stylesheet" href="../../../css/iconfont.css" />
		<link rel="stylesheet" href="../../../css/cmms.css" />
		<link rel="stylesheet" href="../../../css/sale/mine/mine.css" />
		<link rel="stylesheet" href="../../../css/doctor/mine.css" />
	</head>
	<body>
		<div class="mui-content" id="mine" v-cloak>
			<div class="wrap">
			    <header class="panel myHeader overflow" >
			    	<span class="left">
			    		<!--<i class="iconfont icon-touxiang"></i>-->
			    		<img src="../../../img/11.jpg" alt="" />
			    	</span>
			    	<div class="docinfo left">
			    		<span class="doctor-name">{{doctorInfo.doctorName}}</span>
			    		<span class="leader">{{doctorInfo.hospitalName}}</span>
			    	</div>
			    	<div class="roleBox right">
			    		<span class="right btn-tag" v-for="role in doctorInfo.roles">{{role.name}}</span>
			    	</div>
			    	
			    </header>
			    <section class="panel mySection">
			    	<ul>
			    		<!--<li class="overflow" @tap="editMSg">
			    			<i class="iconfont icon-gerenziliao"></i>
			    			<span>我的资料</span>
			    			<i class="iconfont icon-fanhui right"></i>
			    			<span class="right edit-msg">编辑我的基本信息</span>
			    		</li>-->
			    		<li class="overflow" @tap="myClinic">
			    			<i class="iconfont icon-icon1"></i>
			    			<span>我的客户</span>
			    			<i class="iconfont icon-fanhui right"></i>
			    			<span class="right edit-msg">客户信息及成员查看</span>
			    		</li>
			    		<li class="overflow noBottomBorder" @tap="toCoupon">
			    			<i class="iconfont icon-youhuiquan"></i>
			    			<span>我的优惠</span>
			    			<i class="iconfont icon-fanhui right"></i>
			    			<span class="right edit-msg">相关的优惠券</span>
			    		</li>
			    	</ul>
			    </section>
			    <footer class="panel mySection">
			    	<ul>
			    		<li class="overflow noBottomBorder" @tap="logout">
			    			<i class="iconfont icon-tuichu exit"></i>
			    			<span v-show="flag">退出登录</span>
			    			<span v-show="!flag">退出漫游登录</span>
			    		</li>
			    	</ul>
			    </footer>
			    <div id="mask" :class="{'hidden':!modelShow}"></div>
			    <div id="model" :class="{'hidden':!modelShow}">
			    	<p>退出登录</p>
			    	<p>确定要退出登录吗?</p>
			    	<p class="exitBtnBox">
			    		<span @tap="confirm" class="btn-primary">确定</span>
			    		<span @tap="cancel" class="btn-detail">取消</span>
			    	</p>
			    </div>
		    </div>
		</div>
		<script src="../../../js/mui.min.js"></script>
		<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
		<script src="../../../js/vue.js"></script>
		<script src="../../../js/cmms.js?time=333"></script>
		<script>
			new Vue({
				el:"#mine",
				data:{
					doctorInfo:[],
					modelShow:false,
					flag:false
				},
				mounted(){
					this.loadDoctor();
					// console.log(this.flag);
				},
				methods:{
					loadDoctor(){
						let _this = this;
						_this.flag = localStorage.getItem('roamFlag');
						AT.muiAjaxDoctor('/clinic-doctor/doctor/getUserName','post',{},function(res){
//							console.log(res);
							_this.doctorInfo = res;
						});
					},
					editMSg(){
						location.href = "editMsg.html"
					},
					myClinic(){
						location.href = "../myClinic/myClinic.html"
					},
					/*我的优惠券*/
					toCoupon(){
						location.href = "../mine/coupon.html";
					},
					/*退出登录*/
					logout(){
						this.modelShow = true;
					},
					/*确认*/
					confirm(){
						let _this = this;
						_this.modelShow = false;
						AT.muiAjaxDoctor('/passport/logout','post',{},function(realData){
							localStorage.removeItem('doctor_token');
							_this.state = localStorage.getItem('state');
							let loginName = localStorage.getItem('loginName');
							if(_this.flag==true){
								location.href="../../sale/index.html";
							}else{
								window.location.replace(AT.weixinUrl(_this.state,'login-doctor'));
								// window.location.replace("https://open.weixin.qq.com/connect/oauth2/authorize?appid="+_this.state+"&redirect_uri=https%3a%2f%2flis.ulabcare.com%2fulabcare%2flogin-doctor.html&response_type=code&scope=snsapi_base&state="+_this.state+"#wechat_redirect")
//								if(loginName=='boryDoctor'){
//									window.location.replace("https://open.weixin.qq.com/connect/oauth2/authorize?appid="+_this.state+"&redirect_uri=https%3a%2f%2flis.ulabcare.com%2fant-dev%2flogin-bory-doctor.html&response_type=code&scope=snsapi_base&state="+_this.state+"#wechat_redirect")
//								}else if(loginName=='doctor'){
//									window.location.replace("https://open.weixin.qq.com/connect/oauth2/authorize?appid="+_this.state+"&redirect_uri=https%3a%2f%2flis.ulabcare.com%2fant-dev%2flogin-doctor.html&response_type=code&scope=snsapi_base&state="+_this.state+"#wechat_redirect")
//								}else if(loginName=='antDoctor'){
//									window.location.replace("https://open.weixin.qq.com/connect/oauth2/authorize?appid="+_this.state+"&redirect_uri=https%3a%2f%2flis.ulabcare.com%2fant-dev%2flogin-ant-doctor.html&response_type=code&scope=snsapi_base&state="+_this.state+"#wechat_redirect")
//								}
								
							}
						});
					},
					/*取消*/
					cancel(){
						this.modelShow = false;
					}
				}
			})
		</script>
	</body>
</html>
